package com.tg.paw.oms.mq.producer;

import com.tg.paw.common.model.MessageData;
import com.tg.paw.common.util.MessageUtil;
import com.tg.paw.oms.constants.MqConstants;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Rubble
 * @date 2020/6/18
 */
@Service
public class OrderSender {
    @Autowired
    private RabbitTemplate rabbitTemplate;

    public void send(String message){
        message = MessageUtil.wrapMessage(message);
        rabbitTemplate.convertAndSend(MqConstants.DIRECT_EXCHANGE,MqConstants.ORDER_UMS_PAW_ROUTING_KEY,message);
    }
}
